package Eyjafjalla.card.skill;

import Eyjafjalla.action.EyjafjallaAttackAction;
import Eyjafjalla.action.GainCloudEnergyAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.card.attack.Sunshine_Eyjafjalla;
import Eyjafjalla.power.DreitonPower;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class Dreiton_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "Dreiton_Eyjafjalla";
    private static final CardStrings cardStrings;

    public Dreiton_Eyjafjalla(){
        super(ID, cardStrings.NAME,1,cardStrings.DESCRIPTION,CardType.SKILL,CardRarity.UNCOMMON,CardTarget.NONE);
        this.baseMagicNumber = 2;
        this.magicNumber = 2;
        this.exhaust = true;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new Dreiton_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new ApplyPowerAction(p,p,new DreitonPower(p,magicNumber),magicNumber));
    }

    @Override
    public void applyPowers() {
        int trueM = baseMagicNumber;
        if(isFire()){
            baseMagicNumber++;
        }
        magicNumber = baseMagicNumber;
        baseMagicNumber = trueM;
        isMagicNumberModified = baseMagicNumber!=magicNumber;
        super.applyPowers();
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeMagicNumber(1);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}




